package org.dromara.xxmj.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.domain.model.LoginUser;
import org.dromara.common.encrypt.annotation.ApiEncrypt;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.web.core.BaseController;
import org.dromara.xxmj.domain.dto.ForgetPasswordDTO;
import org.dromara.xxmj.domain.vo.UserLoginVo;
import org.dromara.xxmj.service.XxmjRegisterService;
import org.springframework.web.bind.annotation.*;

/**
 * 用户登录控制器
 *
 * @author Lion Li
 */
@Slf4j
@SaIgnore
@RequiredArgsConstructor
@RestController
@RequestMapping("/xxmj/userRelated")
public class XxmjUserLoginController extends BaseController {

    private final XxmjRegisterService registerService;

    /**
     * 用户登录
     *
     * @Author 王晨沣 2307105054
     * @Date 2025-05-17 15:55:30
     */
    @ApiEncrypt
    @PostMapping("/login")
    public R<UserLoginVo> login(@RequestBody String body) {
        UserLoginVo vo = registerService.userLogin(body);
        return R.ok(vo);
    }


}
